import Channel from '@/components/Channel';
import { useAppSelector } from '@/store';
import ArticleList from './components/ArticleList';
import styles from './index.module.scss';
const Home = () => {
  const { currentId, userChannels } = useAppSelector((state) => state.channel);

  return (
    <div className={styles.root}>
      <Channel />
      {userChannels.map((item) => (
        <ArticleList
          key={item.id}
          channel_id={item.id}
          style={{ display: item.id === currentId ? 'block' : 'none' }}
        />
      ))}
    </div>
  );
};

export default Home;
